<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>js学习</title>
	</head>
	<body>
		<script type="text/javascript">
			function test(){
				var sum = 0;
				for(var i=0;i<=100;i++){
					if(i%2===0){
						sum += i
					}
				}
				console.log(sum)
			}
			test()
			
			function getSum(start, end){
				var sum = 0
				for(var i = start; i < end; i++){
					sum += i;
				}
				console.log("结果是: "+sum)
			}
			getSum(5, 50)
		</script>
	</body>
</html>
